home *** CD-ROM | disk | FTP | other *** search
- Path: info.evansville.net!usenet
- From: gilligan@evansville.net (gilligan)
- Newsgroups: comp.lang.c
- Subject: A quick newbie question...hopefully...HELP!
- Date: Sat, 13 Apr 1996 03:58:36 GMT
- Organization: Evansville Online
- Message-ID: <4kn8gk$6t1@info.evansville.net>
- NNTP-Posting-Host: pm02-s2-tier2.evansville.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Hi!
- I am just starting at C, and have a question...one of my problems is I
- have to create a type of "Word Processor" where, regardless of number
- of carriage returns or spaces, I have to cram as many words as
- possible onto one line, be it 65 spaces or 40 (whatever the number),
- but there must be one space in between each word, and the line cannot
- end in the middle of the word. The user is done when he/she hits
- CONTROL-Z, and then everything that he/she has typed is reformatted to
- as many lines as needed. So, in other words, in this program, one
- could type:
- *****************************************************************************************
- THE DOG WENT
- TO THE VET'S PLACE AND THEN REALIZED THAT
- HE
- WAS GETTING
- A SHOT IN THE BUTT.
- *****************************************************************************
- And then when they hit Control-Z, it should read like this:
- THE DOG WENT TO THE VET'S PLACE AND THEN REALIZED THAT HE WAS GETTING
- A SHOT IN THE BUTT.
- So you see how it is like a word processor, kind of. Now, my thoughts
- were either to use GETCHAR, or just get a string at a time, but I am a
- bit confused on this latter part...any ideas would be GREATLY
- appreciated...due to the fact that I don't get back here much, please
- send all questions/comments/suggestions to:
- gilligan@evansville.net
-
- And MANY thanks in return!!
- Gilligan
-
-
-